<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/config/c.tld" prefix="c"%>
<%@ taglib prefix="fn" uri="/WEB-INF/config/fn.tld"%>
<%@ taglib prefix="fmt" uri="/WEB-INF/config/fmt.tld"%>

<!DOCTYPE HTML>
<html>
  <head>
    <title>信息管理</title>
    <script src="Metro/js/jquery-1.9.1.min.js"></script>
  </head>
  <body>
		<ul class="breadcrumb">
			<li>
				<a href="index.html">首页</a>
				<i class="icon-angle-right"></i>
			</li>
			<li>
				<a href="#">修改密码</a>
			</li>
		</ul>
		<div class="row-fluid ">
			<c:if test="${message!=''}">
						<div class="alert alert-success">
							<button type="button" class="close" data-dismiss="alert">×</button>
							<strong>提示!</strong> ${message}.
						</div>
					</c:if>
			<div class="box span12">
				<div class="box-header" data-original-title>
					<h2><i class="halflings-icon white edit"></i><span class="break"></span>请填写您的"新密码"</h2>
					<div class="box-icon">
						<a href="#" class="btn-setting"><i class="halflings-icon white wrench"></i></a>
						<a href="#" class="btn-minimize"><i class="halflings-icon white chevron-up"></i></a>
						<a href="#" class="btn-close"><i class="halflings-icon white remove"></i></a>
					</div>
				</div>
				<div class="box-content">
					
					<form id="form1" class="form-horizontal" action="sysUser/manage/updatePassword.html" method="post">
						<input type="hidden" id="userId" name="sysUserId" value="${session_sysUser.id }">
						<fieldset>
							<div class="control-group hidden-phone">
								<label class="control-label" for="textarea2">账号：</label>
								<div class="controls">
									${session_sysUser.userName }
								</div>
							</div>
							<div class="control-group hidden-phone">
								<label class="control-label" for="password">原密码：</label>
								<div class="controls">
									<input type="text" class="span6 typeahead" id="password" name="password"> 
									 <span id="span1" style="color:red;"></span>
								</div>
							</div>
							<div class="control-group hidden-phone">
								<label class="control-label" for="password1">新密码：</label>
								<div class="controls">
									<input type="text" class="span6 typeahead" id="password1" name="password1">  
									<span id="span2" style="color:red;"></span>
								</div>
							</div>
							<div class="control-group hidden-phone">
								<label class="control-label" for="newPassword">确认密码：</label>
								<div class="controls">
									<input type="text" class="span6 typeahead" id="newPassword" name="newPassword"> 
									<span id="span3" style="color:red;"></span>
								</div>
							</div>
							<div class="form-actions">
								<button type="submit" class="btn btn-primary submitBut">保存信息</button>
							</div>
						</fieldset>
					</form>
				</div>
			</div><!--/span-->
		</div><!--/row-->
		<script>
			$(".submitBut").click(function(){
				var password=$("#password").val();//原密码
				var password1=$("#password1").val();//新密码
				var newPassword =$("#newPassword").val();//确认密码
				if(password == ""){
					$("#span1").html("原密码不能为空")
					return false;
				} else{
					$("#span1").html("");
				}
				if(password1 == ""){
					$("#span2").html("新密码不能为空")
					return false;
				} else{
					$("#span2").html("");
				}
				if(newPassword == ""){
					$("#span3").html("确认密码不能为空")
					return false;
				} else{
					$("#span3").html("");
				}
				var temp=${session_sysUser.id}
				if(temp!=password){
					$("#span1").html("原密码不正确");
					return false;
				}
				if(password1 != newPassword){
					$("#span3").html("确认密码与新密码不符");
					return false;
				} else{
					$("#span3").html("");
				}
			})
		</script>
  </body>
</html>
